﻿//-----------------------------------------------------------------------
// <copyright file="Copyright.cs" author="Michael Herndon">
//     Copyright (c) Michael Herndon.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Amplify.Twitter
{
	using System.ServiceModel;
	using System.ServiceModel.Web;

	/// <summary>
	/// Contract for twitter Account methods. 
	/// </summary>
	[ServiceContract]
	public interface IAccountClient
	{
		/// <summary>
		/// Verifies if the user is able to log in with the current credentials.
		/// </summary>
		/// <returns>returns true if the user could login, otherwise false.</returns>
		/// <exception cref="System.ServiceModel.Security.MessageSecurityException" />
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		
		[OperationContract,
			WebInvoke(
				BodyStyle = WebMessageBodyStyle.Bare,
				ResponseFormat = WebMessageFormat.Json,
				UriTemplate = "/account/verify_credentials.json")]
		VerifyResponse Verify();

		/// <summary>
		/// Ends the session of the current user if they are logged in.
		/// </summary>
		/// <exception cref="System.ServiceModel.Security.MessageSecurityException" />
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract,
			WebInvoke(
				UriTemplate = "/account/end_session")]
		void EndSession();

		/// <summary>
		/// Updates the location information about the user.
		/// </summary>
		/// <param name="location">The location, currently not geo cordinates</param>
		/// <returns>returns a <see cref="Amplify.Twitter.User"/> object. </returns>
		/// <exception cref="System.ServiceModel.Security.MessageSecurityException" />
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract,
			WebInvoke(
				BodyStyle = WebMessageBodyStyle.Bare,
				ResponseFormat = WebMessageFormat.Json,
				UriTemplate = "/account/update_location.json?location={location}")]
		User UpdateLocation(string location);


		/// <summary>
		/// Updates the delivery device the user wants to recieive notifications on. 
		/// </summary>
		/// <param name="device">The currently allowed devices</param>
		/// <returns>returns a <see cref="Amplify.Twitter.User"/> object. </returns>
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract,
			WebInvoke(
				BodyStyle = WebMessageBodyStyle.Bare,
				ResponseFormat = WebMessageFormat.Json,
				UriTemplate = "/account/update_delivery_device.json?device={device}")]
		User UpdateDeliveryDevice(string device);


		/// <summary>
		/// Gets the current rate limit status of the user.
		/// </summary>
		/// <remarks>
		///		<para>
		///			This is the only method of twitters api that does not count
		///			against your allowed rate hits per user. 
		///		</para>
		/// </remarks>
		/// <returns>returns a <see cref="Amplify.Twitter.RateStatus"/> object.</returns>
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract,
			WebInvoke(
				BodyStyle = WebMessageBodyStyle.Bare,
				ResponseFormat = WebMessageFormat.Json,
				UriTemplate = "/account/rate_limit_status.json")]
		RateStatus GetRateStatusLimit();
	}
}
